package handler;

/* File: EquateNode.java
 * Programmers: Brad Hietpas, Matt Wienkes & Gabrielle DuBois
 */

import java.io.*;
import java.util.ArrayList;

public class EquateNode{
	private String eq;
	private ArrayList<IntervalNode> in = new ArrayList<IntervalNode>();

	/**
	 * EquateNode()
	 * @param equation is a string of the equation
	 */
	public EquateNode(String equation){
		eq = equation;
	}//constructor

	/**
	 * addInterval()
	 * @param node is an IntervalNode object
	 */
	public void addInterval(IntervalNode node){
		in.add(node);
	}//addInterval(int)

	/**
	 * getIntervals()
	 * @return an ArrayList of InteralNodes
	 */
	public ArrayList<IntervalNode> getIntervals(){
		return in;
	}//getIntervals()

	/**
	 * getEquation()
	 * @return a string of the equation
	 */
	public String getEquation(){
		return eq;
	}//getEquation()

	/**
	 * deleteInterval()
	 * @param node i an IntervalNode object
	 */
	 public void deleteInterval(IntervalNode node){
		in.remove( in.indexOf(new IntervalNode( node.getA(), node.getB() )) );
	}//deleteInterval(int)

}//EquateNode
